home *** CD-ROM | disk | FTP | other *** search
Text File | 1997-06-28 | 527 b | 39 lines | [TEXT/CWIE] |
- // FileLoop.cp
-
- #ifndef FileLoop_h
- #include "FileLoop.h"
- #endif
- #ifndef FileNotFoundError_h
- #include "FileNotFoundError.h"
- #endif
-
- FileLoop::FileLoop( Directory theDirectory )
- : directory( theDirectory ),
- index( 1 ),
- finished( false )
- {
- GetInfo();
- }
-
- void FileLoop::operator++()
- {
- Assert( !finished );
- index++;
- GetInfo();
- }
-
- void FileLoop::GetInfo()
- {
- Assert( !finished );
-
- try
- {
- info.Get( directory, index );
- }
- catch ( FileNotFoundError error )
- {
- error.Fix();
- finished = true;
- }
- }
-